<%--
  Created by IntelliJ IDEA.
  User: 123
  Date: 2024/6/28
  Time: 11:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ page import="java.util.List" %>

<%@ page import="qin.com.ChengJi" %>

<%@ page import="qin.com.ChengjiDao" %>

<html>

<head>



    <title>超级管理员列表</title>

    <style>

        /* 使用Flexbox布局使得框在屏幕上垂直和水平居中 */

        .my-container {

            display: flex;

            justify-content: center;

            align-items: center;

        }

    </style>

    <script type= "text/javascript" language= "javascript" >

        //用于删除时，提示是否要删除

        function confirmAct()

        {

            if (confirm('确认要删除吗?（y/n' ))

            {

                return true ;

            }

            return false ;

        }

    </script>



</head>

<body>

<a href="insertchengji.jsp">添加用户</a>

<table border="1" width="100%">

    <tr>

        <td>id</td>

        <td>name</td>

        <td>pass</td>

        <td>操作</td>

    </tr>

    <%

        List<ChengJi> list= ChengjiDao.getAllChengJi();

        for(int i=0;i<list.size();i++){

    %>

    <tr>

        <td><%=list.get(i).getId()%></td>

        <td><%=list.get(i).getName()%></td>

        <td><%=list.get(i).getJava()%></td>
        <td><%=list.get(i).getJsp()%></td>
        <td><%=list.get(i).getOracle()%></td>

        <td>

            <a href="updatechengji.jsp?id=<%=list.get(i).getId()%>">更新用户</a>

            <a href="delete&id=<%=list.get(i).getId()%>"  onclick　= "return confirmAct();">删除用户</a>

        </td>

    </tr>

    <%

        }

    %>

</table>

</body>

</html>